<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Hexo, NexT" />





  <link rel="alternate" href="/atom.xml" title="Da'sBlog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="Whoever wants to be first must be slave of all.">
<meta property="og:type" content="website">
<meta property="og:title" content="Da&#39;sBlog">
<meta property="og:url" content="http://sunhao.win/page/4/index.html">
<meta property="og:site_name" content="Da&#39;sBlog">
<meta property="og:description" content="Whoever wants to be first must be slave of all.">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Da&#39;sBlog">
<meta name="twitter:description" content="Whoever wants to be first must be slave of all.">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"right","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://sunhao.win/page/4/"/>





  <title> Da'sBlog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b8432f1a5c5c27d6783c25569df4b270";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










  
  
    
  

  <div class="container one-collumn sidebar-position-right 
   page-home 
 ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Da'sBlog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
    
      <h1 class="site-subtitle" itemprop="description"></h1>
    
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>
<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">


        
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
        


      
        
        <li class="menu-item menu-item-categories">


        
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
        


      
        
        <li class="menu-item menu-item-archives">


        
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
        


      
        
        <li class="menu-item menu-item-compass">


        
          <a href="/2017/01/11/compass" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th-list"></i> <br />
            
            compass中文手册
          </a>
        </li>
        


      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>


    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/window-mklink.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/window-mklink.html" itemprop="url">
                  window命令mklink 创建符号链接 硬链接 目录联结
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-03-05T11:15:53+08:00">
                2017-03-05
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/window/" itemprop="url" rel="index">
                    <span itemprop="name">window</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <p>最近研究mklink 发现国内很多文档认识有错误  或者不充分，在此补充下。</p>
<ol>
<li>符号链接 用的比较多  也就是我们的快捷方式</li>
<li>硬链接  用的很少  可以防止误删，省空间等、</li>
<li>目录联结   一般用于共享目录<h3 id="链接的本质是创建一个指向原文件的路径"><a href="#链接的本质是创建一个指向原文件的路径" class="headerlink" title="链接的本质是创建一个指向原文件的路径"></a>链接的本质是创建一个指向原文件的路径</h3></li>
</ol>
<p><img src="http://ojlt0g866.bkt.clouddn.com/blog/20170305/130909564.png" alt="mark"><br>我们的文件其实是存在磁盘空间中， 文件名指向磁盘空间，最后访问文件名  访问到它所指向的空间。</p>
<p><img src="http://ojlt0g866.bkt.clouddn.com/blog/20170305/112747867.png" alt="mark"></p>
<ol>
<li><p>符号链接<br>mklink /d</p>
<p>和快捷方式几乎。但与其不同的是快捷方式是.link后缀的文件。</p>
<p>删除原文件，这种链接就无效了</p>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/window-mklink.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/window-tasklist-taskkill-netstat.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/window-tasklist-taskkill-netstat.html" itemprop="url">
                  window命令 端口占用、查杀进制
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-03-05T11:15:53+08:00">
                2017-03-05
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/window/" itemprop="url" rel="index">
                    <span itemprop="name">window</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <p>cmd关闭php的一个示例</p>
<h3 id="首先用php-S-开启一个服务"><a href="#首先用php-S-开启一个服务" class="headerlink" title="首先用php -S 开启一个服务"></a>首先用php -S 开启一个服务</h3><p><img src="http://ojlt0g866.bkt.clouddn.com/blog/20170312/185351151.png" alt="mark"></p>
<h3 id="另开一个窗口，查询占用了8081端口的进程：netstat-ano-findstr-8081，找到pid为12552"><a href="#另开一个窗口，查询占用了8081端口的进程：netstat-ano-findstr-8081，找到pid为12552" class="headerlink" title="另开一个窗口，查询占用了8081端口的进程：netstat -ano|findstr 8081，找到pid为12552"></a>另开一个窗口，查询占用了8081端口的进程：netstat -ano|findstr 8081，找到pid为12552</h3><p><img src="http://ojlt0g866.bkt.clouddn.com/blog/20170312/185609267.png" alt="mark"></p>
<h3 id="tasklist-findstr-12552-。发现就是我们的php服务"><a href="#tasklist-findstr-12552-。发现就是我们的php服务" class="headerlink" title="tasklist|findstr 12552 。发现就是我们的php服务"></a>tasklist|findstr 12552 。发现就是我们的php服务</h3><p><img src="http://ojlt0g866.bkt.clouddn.com/blog/20170312/185736720.png" alt="mark"></p>
<h3 id="taskkill-f-t-im-php-exe"><a href="#taskkill-f-t-im-php-exe" class="headerlink" title="taskkill /f /t /im php.exe"></a>taskkill /f /t /im php.exe</h3><p>/f 强制<br>/t 关闭子进程<br>/im 文件名<br>taskkill /f /PID 12552<br>/PID 删除指定pid<br>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/window-tasklist-taskkill-netstat.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/data-structure-set.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/data-structure-set.html" itemprop="url">
                  数据结构-集合论，集合,数组 大O 第一篇
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-03-02T08:55:57+08:00">
                2017-03-02
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/数据结构/" itemprop="url" rel="index">
                    <span itemprop="name">数据结构</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <h3 id="集合论-集合论或集论是研究集合（由一堆抽象物件构成的整体）的数学理论-包含了集合、元素和成员关系等最基本的数学概念。"><a href="#集合论-集合论或集论是研究集合（由一堆抽象物件构成的整体）的数学理论-包含了集合、元素和成员关系等最基本的数学概念。" class="headerlink" title="集合论: 集合论或集论是研究集合（由一堆抽象物件构成的整体）的数学理论,包含了集合、元素和成员关系等最基本的数学概念。"></a>集合论: 集合论或集论是研究集合（由一堆抽象物件构成的整体）的数学理论,包含了集合、元素和成员关系等最基本的数学概念。</h3><h3 id="集合（简称集）是数学中一个基本概念，它是集合论的研究对象-集合就是“一堆东西”。集合里的“东西”，叫作元素。"><a href="#集合（简称集）是数学中一个基本概念，它是集合论的研究对象-集合就是“一堆东西”。集合里的“东西”，叫作元素。" class="headerlink" title="集合（简称集）是数学中一个基本概念，它是集合论的研究对象.集合就是“一堆东西”。集合里的“东西”，叫作元素。"></a>集合（简称集）是数学中一个基本概念，它是集合论的研究对象.集合就是“一堆东西”。集合里的“东西”，叫作元素。</h3><p>集合A和B的并集，符号为A ∪ B<br>集合A和B的交集，符号为A ∩ B<br>集合U和A的相对差集，符号为U \ A<br>集合A和B的对称差，符号为A △ B或A⊕B</p>
<p>编程中的数组 是集合中的一种表现形式。</p>
<p>数组是在程序设计中，为了处理方便， 把具有相同类型的若干变量按有序的形式组织起来的一种形式。这些按序排列的同类数据元素的集合称为数组。<br>其中具有相同类型的若干变量按有序的形式组织起来的一种形式   就是我们说的成员关系。</p>
<p>①[x，y] ：中括号表示包括边界数字，即表示大于等于x小于等于y<br>②(x，y)：小括号是不包括边界，即表示大于x小于y<br>所以我们的数组 用[]来声明。而()已经被函数占用，所以不考虑。<br>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/data-structure-set.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/python-list-tuple-dict-set.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/python-list-tuple-dict-set.html" itemprop="url">
                  python-列表list,元组tuple,字典dict,集合set
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-03-02T08:40:27+08:00">
                2017-03-02
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index">
                    <span itemprop="name">python</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <p>数序: 全称是数字序列，就是指数字按照一定规律所排出来的顺序。<br>序数: 表顺序的数,像第1、第2、第3。</p>
<p>序列的两个特点：<br>1.索引操作符，从序列中抓取一个特定项目<br>2.和切片操作符，获取序列的一个切片，即一部分序列</p>
<p>Python一些内置函数<br>1、cmp(A, B)：比较可为list、tuple等的A、B，A&gt;B为1，A=B为0，小于为-1<br>2、len(obj)： 计算元素个数。<br>3、max(obj)：返回元素最大值。<br>4、min(obj)：返回元素最小值。<br>5、reversed(obj): 对元素进行翻转<br>6、enumerate(obj): 遍历list的元素，返回序号及其对应的元素 for x，y in list：<br>7、zip():打包成tuple（元组），然后返回由这些tuples组成的list（列表）</p>
<p>列表、元组和字符串都是序列，字符串是字符的序列，列表和元祖是任意类型的序列</p>
<p>列表list，用中括号“[ ]”表示</p>
<p>1.任意对象的有序集合<br>列表是一组任意类型的值，按照一定顺序组合而成的<br>2.通过偏移读取<br>组成列表的值叫做元素(Elements)。每一个元素被标识一个索引，第一个索引是0，序列的功能都能实现<br>3.可变长度，异构以及任意嵌套<br>列表中的元素可以是任意类型，甚至是列表类型，也就是说列表可以嵌套<br>4.可变的序列<br>支持索引、切片、合并、删除等等操作，它们都是在原处进行修改列表<br>5.对象引用数组<br>列表可以当成普通的数组，每当用到引用时，Python总是会将这个引用指向一个对象，所以程序只需处理对象的操作。当把一个对象赋给一个数据结构元素或变量名时，Python总是会存储对象的引用，而不是对象的一个拷贝</p>
<p>#!/usr/bin/env python</p>
<p>#coding:utf-8</p>
<p>‘’’<br>FuncName: study_list.py<br>Desc: list 内建函数<br>Date: 2016-03-17 14:00<br>Author: johnny<br>‘’’</p>
<p> L.append(var)              # 追加元素，加在最后<br> L.insert(index,var)        # 在index的位置追加元素，位置就是索引<br> L.pop(var)                 # 从list中删除最后一个元素，并返回该元素<br> L.remove(var)              # 删除第一次出现的该元素<br> L.count(var)               # 该元素在列表中出现的个数<br> L.index(var)               # 该元素的位置（索引号）,无则抛异常<br> L.extend(list)             # 追加list，即合并list到L上，两个列表合并<br> L.sort()                   # 排序<br> L.reverse()                # 原地翻转列表，从前到后变成从后向前<br> l = [1,2,3,4,[‘hello’,’johnny’],’blog.csdn.net/z_johnny’]   # 创建list<br> l[1:5:2]                   # list的切片，切一部分，范围为索引[1，5)，即1、2、3、4不包括5，隔2取1个值 l[1:5:2] == [2, 4]<br> l[1]                       # list的索引，左1索引为0，右1索引为-1，l[1] == 2<br> l[4][1]                    # 列表支持嵌套，l[4][1] == ‘johnny’</p>
<p>list的官方内置函数可用dir(list)与help(list) 命令进行查看</p>
<p>元祖tuple，用小括号“( )”表示</p>
<p>1.任意对象的有序集合<br>与列表相同<br>2.通过偏移存取<br>与列表相同<br>3.属于不可变序列类型<br>类似于字符串，但元组是不可变的，不支持在列表中任何原处修改操作，不支持任何方法调用<br>4.固定长度、异构、任意嵌套<br>固定长度即元组不可变，在不被拷贝的情况下长度固定，其他同列表<br>5.对象引用的数组<br>与列表相似，元祖是对象引用的数组</p>
<p>和list相比<br>1.比列表操作速度快<br>2.对数据“写保护“<br>3.可用于字符串格式化中<br>4.可作为字典的key</p>
<p>#!/usr/bin/env python</p>
<p>#coding:utf-8</p>
<p>‘’’<br>FuncName: study_tuple.py<br>Desc: tuple 内建函数<br>Date: 2016-03-17 14:00<br>Author: johnny<br>‘’’</p>
<p> t.count(var)               # 该元素在元组中出现的个数<br> t.index(var)               # 该元素的位置（索引号）,无则抛异常<br> t = (1,2,3,4,[‘hello’,’johnny’],’blog.csdn.net/z_johnny’)   # 创建tuple<br> tu = (5,)                  # 只含有一个元素的元祖，必须加逗号“,”<br> t[1:5:2]                   # tuple的切片，切一部分，范围为索引[1，5)，即1、2、3、4不包括5，隔2取1个值 t[1:5:2]== (2, 4)<br> t[1]                       # tuple的索引，左1索引为0，右1索引为-1，t[1] == 2<br> t[4][1]                    # 同列表一样支持嵌套，t[4][1] == ‘johnny’</p>
<p>tuple的官方内置函数可用dir(tuple)与help(tuple) 命令进行查看</p>
<p>字典dict，用大括号“{key，value}”表示</p>
<p>1.通过键而不是偏移量来读取<br>字典就是一个关联数组，是一个通过关键字索引的对象的集合，使用键-值（key-value）进行存储，查找速度快<br>2.任意对象的无序集合<br>字典中的项没有特定顺序，以“键”为象征<br>3.可变长、异构、任意嵌套<br>同列表，嵌套可以包含列表和其他的字典等<br>4.属于可变映射类型<br>因为是无序，故不能进行序列操作，但可以在远处修改，通过键映射到值。字典是唯一内置的映射类型（键映射到值的对象）<br>5.对象引用表<br>字典存储的是对象引用，不是拷贝，和列表一样。字典的key是不能变的，list不能作为key，字符串、元祖、整数等都可以</p>
<p>和list比较，dict有以下几个特点：<br>1.查找和插入的速度极快，不会随着key的增加而增加<br>2.需要占用大量的内存，内存浪费多<br>而list相反：<br>1.查找和插入的时间随着元素的增加而增加<br>2.占用空间小，浪费内存很少<br>所以，dict是用空间来换取时间的一种方法</p>
<p>#!usr/bin/env python</p>
<p>#coding:utf-8</p>
<p>‘’’<br>FuncName: study_dict.py<br>Desc: dict 内建函数<br>Date: 2016-03-17 14:00<br>Author: johnny<br>‘’’</p>
<p>d = {‘Name’: ‘Johnny’, ‘Address’:’blog.csdn.net/z_johnny’}  # 创建dict<br>d[‘Name’]                      # 找出key为Name的值 d[‘Name’] == ‘Johnny’<br>d[‘Name’] = hello              # 更新key为Name的值 Name对应的值从Johnny改为hello<br>del d[‘Address’]               # 删除key为Name的值和该key d = {‘Name’: ‘Johnny’}<br>d.clear()                      # 删除字典d中的所有元素 d = {}<br>d.pop(‘Name’)                  # 删除字典d中key为’Name’的值和该键<br>d.copy()                       # 返回字典d的浅复制副本<br>d.fromkeys(S[,v])              # 创建一个新的字典，设置键为seq 和值为value<br>d.get(key, default=None)       # 返回该键key的值，若没有该键，则返回None<br>d.has_key(key)                 # 如果在字典d中存在键key，则返回true，否则返回 false<br>d.items()                      # 返回字典的（键，值）元组对的列表<br>d.keys()                       # 返回字典的键的列表<br>d.values()                     # 返回字典d的值列表<br>d.setdefault(key, default=None)# 类似get()</p>
<pre><code># 但会设定d[key]=default 如果key不在字典d中
</code></pre><p>d.update(d2)                   # 将字典d2的键值对增加到字典d中<br>d.iteritems()                  # （键，值）项的一个迭代器<br>d.iterkeys()                   # 字典d中键的一个迭代器<br>d.itervalues()                 # 字典d中值的一个迭代器<br>d.popitem()                    # 删除元组返回键、值，若字典d为空会报key错<br>d.viewitems()                  # 像对象一样提供字典d中项的一个视图<br>d.viewkeys()                   # 像对象一样提供字典d中key的一个视图<br>d.viewvalues()                 # 像对象一样提供字典d中value的一个视图  </p>
<p>dict的官方内置函数可用dir(dict)与help(dict) 命令进行查看</p>
<p>集合set，用小括号“( )”表示</p>
<p>1.是一组key的集合，但不存储value，并且key不能重复<br>创建一个set，需要提供一个list作为输入集合,s = set([1,2,3]),注意，传入的参数 [1, 2, 3] 是一个list，而显示的 set([1, 2, 3]) 只是告诉你这个set内部有1，2，3这3个元素，显示的[ ]不表示这是一个list<br>2.重复元素在set中自动被过滤<br>set可以看成数学意义上的无序和无重复元素的集合，因此，两个set可以做数学意义上的交集、并集等操作</p>
<p>还有一种集合是forzenset( )，是冻结的集合，它是不可变的，存在哈希值，好处是它可以作为字典的key，也可以作为其它集合的元素。缺点是一旦创建便不能更改，没有add，remove方法</p>
<p>和dict对比<br>1.set和dict的唯一区别仅在于没有存储对应的value<br>2.set的原理和dict一样，同样不可以放入可变对象，因为无法判断两个可变对象是否相等，也就无法保证set内部“不会有重复元素”</p>
<p>#!usr/bin/env python</p>
<p>#coding:utf-8</p>
<p>‘’’<br>FuncName: study_set.py<br>Desc: set 内建函数<br>Date: 2016-03-17 14:00<br>Author: johnny<br>‘’’</p>
<p>s = set([1,2,3])            # 创建一个数值set，有1，2，3三个元素s == set([1, 2, 3])<br>se = set(‘Hello’)           # 创建一个唯一字符的集合s == set([‘H’, ‘e’, ‘l’, ‘o’])<br>a = s | se                  # s 和 se 的并集 set([1, 2, 3, ‘e’, ‘H’, ‘l’, ‘o’])<br>b = s &amp; se                  # s 和 se 的交集 set([]) 没有相同项为空<br>c = s – se                 # 求差集（项在s中，但不在se中） set([1, 2, 3])<br>d = s ^ se                  # 对称差集（项在s或se中，但不会同时出现在二者中）</p>
<pre><code># set([1, 2, 3, &apos;e&apos;, &apos;H&apos;, &apos;l&apos;, &apos;o&apos;])
</code></pre><p>s.issubset(t)               # 如果s是t的子集,则返回True,否则返回False<br>s.issuperset(t)             # 如果t是s的超集,则返回True,否则返回False<br>s.union(t)                  # 返回一个新集合,该集合是s和t的并集<br>s.intersection(t)           # 返回一个新集合,该集合是s和t的交集<br>s.difference(t)             # 返回一个新集合,该集合是 s 的成员,但不是 t 的成员<br>s.symmetric_difference(t)   # 返回一个新集合,该集合是s或t的成员,但不是s和t共有的成员<br>s.copy()                    # 返回一个新集合,它是集合s的浅复制<br>s.update(t)                 # 用t中的元素修改s，即s现在包含s或t的成员<br>s.intersection_update(t)    # s中的成员是共同属于s和t中的元素<br>s.difference_update(t)      # s中的成员是属于s但不包含在t中的元素<br>s.symmetric_difference_update(t)    # s中的成员更新为那些包含在s或t中，</p>
<pre><code># 但不是s和t共有的元素
</code></pre><p>s.add(obj)                  # 在集合s中添加对象obj<br>s.remove(obj)               # 从集合s中删除对象obj，如果obj不是集合s中的元素</p>
<pre><code># （obj not in s），将引发KeyError
</code></pre><p>s.discard(obj)              # 如果obj是集合s中的元素，从集合s中删除对象obj<br>s.pop()                     # 删除集合是中的任意一个对象，并返回它<br>s.clear()                   # 删除集合s中的所有元素</p>
<p>set的官方内置函数可用dir(set)与help(set) 命令进行查看<br>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/python-list-tuple-dict-set.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/safe-noun.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/safe-noun.html" itemprop="url">
                  名词 吞吐量 带宽 QPS TPS DDOS流量 并发用户数
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-03-01T09:00:44+08:00">
                2017-03-01
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/网络安全/" itemprop="url" rel="index">
                    <span itemprop="name">网络安全</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <h3 id="Throughput：吞吐量。防火墙吞吐量是指在没有帧丢失的情况下，设备能够接收并转发的最大数据速率。-1"><a href="#Throughput：吞吐量。防火墙吞吐量是指在没有帧丢失的情况下，设备能够接收并转发的最大数据速率。-1" class="headerlink" title="Throughput：吞吐量。防火墙吞吐量是指在没有帧丢失的情况下，设备能够接收并转发的最大数据速率。[1]"></a>Throughput：吞吐量。防火墙吞吐量是指在没有帧丢失的情况下，设备能够接收并转发的最大数据速率。[1]</h3><h3 id="Max-net-bitrate-带宽。指链路上每秒所能传送的比特数，它取决于链路时钟速率和信道编码在计算机网络中又称为线速。可以说以太网的带宽是10Mbps。"><a href="#Max-net-bitrate-带宽。指链路上每秒所能传送的比特数，它取决于链路时钟速率和信道编码在计算机网络中又称为线速。可以说以太网的带宽是10Mbps。" class="headerlink" title="Max net bitrate: 带宽。指链路上每秒所能传送的比特数，它取决于链路时钟速率和信道编码在计算机网络中又称为线速。可以说以太网的带宽是10Mbps。"></a>Max net bitrate: 带宽。指链路上每秒所能传送的比特数，它取决于链路时钟速率和信道编码在计算机网络中又称为线速。可以说以太网的带宽是10Mbps。</h3><p>两者需要区分链路上的可用带宽（带宽）与实际链路中每秒所能传送的比特数（吞吐量）。通常更倾向于用“吞吐量”一词来表示一个系统的测试性能。这样，因为实现受各种低效率因素的影响，所以由一段带宽为10Mbps的链路连接的一对节点可能只达到2Mbps的吞吐量。</p>
<h3 id="QPS：Queries-Per-Second意思是“每秒查询率”，是一台服务器每秒能够相应的查询次数，是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。为域名系统服务器的机器的性能经常用每秒查询率来衡量。对应fetches-sec，即每秒的响应请求数，也即是最大吞吐能力。"><a href="#QPS：Queries-Per-Second意思是“每秒查询率”，是一台服务器每秒能够相应的查询次数，是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。为域名系统服务器的机器的性能经常用每秒查询率来衡量。对应fetches-sec，即每秒的响应请求数，也即是最大吞吐能力。" class="headerlink" title="QPS：Queries Per Second意思是“每秒查询率”，是一台服务器每秒能够相应的查询次数，是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。为域名系统服务器的机器的性能经常用每秒查询率来衡量。对应fetches/sec，即每秒的响应请求数，也即是最大吞吐能力。"></a>QPS：Queries Per Second意思是“每秒查询率”，是一台服务器每秒能够相应的查询次数，是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。为域名系统服务器的机器的性能经常用每秒查询率来衡量。对应fetches/sec，即每秒的响应请求数，也即是最大吞吐能力。</h3>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/safe-noun.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/css-top-right-bootom-left-zero.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/css-top-right-bootom-left-zero.html" itemprop="url">
                  position:absolute-top,right,bottom,left为0使用
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-02-26T19:27:57+08:00">
                2017-02-26
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/css/" itemprop="url" rel="index">
                    <span itemprop="name">css</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <p>  绝对定位一直用起来非常方便，直接脱离文本流。偶然发现它还有个超强的功能。竟然可以撑开盒子宽高。</p>
<h2 id="对外"><a href="#对外" class="headerlink" title="对外"></a>对外</h2><h3 id="默认情况下，看代码；盒子如果设置-宽高后-设置绝对定位-bottom为0会自动抵底部。"><a href="#默认情况下，看代码；盒子如果设置-宽高后-设置绝对定位-bottom为0会自动抵底部。" class="headerlink" title="默认情况下，看代码；盒子如果设置   宽高后   设置绝对定位,bottom为0会自动抵底部。"></a>默认情况下，看代码；盒子如果设置   宽高后   设置绝对定位,bottom为0会自动抵底部。</h3><p><img src="http://ojlt0g866.bkt.clouddn.com/blog/20170226/194602705.png" alt="mark"><br><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">html</span> <span class="attr">lang</span>=<span class="string">"en"</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">"UTF-8"</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">title</span>&gt;</span>Document<span class="tag">&lt;/<span class="name">title</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">style</span>&gt;</span><span class="undefined"></span></div><div class="line">            .wai&#123;</div><div class="line">                position:relative;</div><div class="line">                top: 300px;</div><div class="line">                left: 300px;</div><div class="line">                width: 233px;</div><div class="line">                height: 370px;</div><div class="line">                background-color: yellow;</div><div class="line"></div><div class="line">            &#125;</div><div class="line">            .nei&#123;</div><div class="line">                position: absolute;</div><div class="line">                /*top: 0px;*/</div><div class="line">                /*left: 0px;</div><div class="line">                right: 0px;*/</div><div class="line">                bottom: 0px;</div><div class="line">                width: 100px;</div><div class="line">                height: 100px;</div><div class="line">                background-color: rgba(200,200,200,0.7);</div><div class="line">            &#125;</div><div class="line"></div><div class="line">        <span class="tag">&lt;/<span class="name">style</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></div><div class="line">     <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"wai"</span>&gt;</span></div><div class="line">             <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"nei"</span>&gt;</span></div><div class="line">                    <span class="comment">&lt;!--  &lt;div class="nei-item1"&gt;1&lt;/div&gt;</span></div><div class="line">                     &lt;div class="nei-item2"&gt;2&lt;/div&gt; --&gt;</div><div class="line">             <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">     <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></div></pre></td></tr></table></figure></p>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/css-top-right-bootom-left-zero.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/safe-iptables.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/safe-iptables.html" itemprop="url">
                  使用iptables应对SYN攻击,CC攻击,ACK攻击[转]
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-02-24T14:58:05+08:00">
                2017-02-24
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/网络安全/" itemprop="url" rel="index">
                    <span itemprop="name">网络安全</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <p>三次握手的过程及相关概念<br>TCP/IP协议使用三次握手来建立连接，过程如下：<br>1、第一次握手，客户端发送数据包syn到服务器，并进入SYN_SEND状态，等待回复<br>2、第二次握手，服务器发送数据报syn/ack，给客户机，并进入SYN_RECV状态，等待回复<br>3、第三次握手，客户端发送数据包ACK给客户机，发送完成后，客户端和服务器进入ESTABLISHED状态，链接建立完成</p>
<p>三次握手协议中，服务器维护一个等待队列，收到一个syn包就在队列中建立一个条目，并分配一定的资源。对应的每一个条目表示已经收到一个syn请 求，并已经回复syn/ack，服务器上对应的连接已经进入SYN_RECV状态，等待客户端响应，收到客户端的响应包以后，该连接进入 ESTABLISHED状态，队列中对应的条目被删除。<br>backlog参数：设定等待队列的最大数目。对应内核参数：net.ipv4.tcp_max_syn_backlog = 1024<br>syn-ack重传次数：服务器发送syn/ack包，如果没有收到客户端的相应，就会重传syn/ack，超过一定时间之后会进行第二次重传，超过设定 次数以后将该条目从队列中删除。每次重传的间隔时间并不确定。对应的内核参数：net.ipv4.tcp_synack_retries = 5<br>syn重传次数：概念和syn/ack重传次数类似，对应的内核参数：net.ipv4.tcp_syn_retries = 5<br>等待存活时间：指等待队列的条目存活时间，即从服务器收到syn包到确认这个包无效的最长时间，该时间是所有重传包请求的最长等待时间<br>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/safe-iptables.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/safe-cc.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/safe-cc.html" itemprop="url">
                  服务器网站被CC攻击的解决方法
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-02-24T14:02:15+08:00">
                2017-02-24
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/网络安全/" itemprop="url" rel="index">
                    <span itemprop="name">网络安全</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <p>作为站长或者公司的网站的网管，什么最可怕？显然是网站受到的DDoS攻击。大家都有这样的经历，就是在访问某一公司网站或者论坛时，如果这个网站或者论坛流量比较大，访问的人比较多，打开页面的速度会比较慢，对不?!一般来说，访问的人越多，网站或论坛的页面越多，数据库就越大，被访问的频率也越高，占用的系统资源也就相当可观。</p>
<p>首先，什么事CC攻击？</p>
<p>攻击者借助代理服务器生成指向受害主机的合法请求，实现DDOS,和伪装就叫：CC(ChallengeCollapsar)。<br>CC主要是用来攻击页面的。大家都有这样的经历，就是在访问论坛时，如果这个论坛比较大，访问的人比较多，打开页面的速度会比较慢，访问的人越多，论坛的页面越多，数据库就越大，被访问的频率也越高，占用的系统资源也就相当可观。<br>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/safe-cc.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/study-clojure.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/study-clojure.html" itemprop="url">
                  study clojure
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-02-21T21:41:25+08:00">
                2017-02-21
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <a id="more"></a>
          
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://sunhao.win/articles/compass.html">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Sun Hao">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Da'sBlog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Da'sBlog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/articles/compass.html" itemprop="url">
                  Compass中文手册
                </a>
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-11T15:10:57+08:00">
                2017-01-11
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          <h1 id="开始"><a href="#开始" class="headerlink" title="开始"></a>开始</h1><p>compass目前已经不再维护，但有些东西仍值得学习。</p>
<p><strong>Version: 1.0.1</strong></p>
<h2 id="开始使用Compass"><a href="#开始使用Compass" class="headerlink" title="开始使用Compass"></a>开始使用Compass</h2><p>Compass 是一款使用<a href="http://sass-lang.com" target="_blank" rel="external">Sass语言</a> 编写的开源的css设计框架，使用<br>起来强大和简单. 如果你对Sass不熟悉, 可以去<a href="http://sass-lang.com" target="_blank" rel="external">sass-lang.com</a>学习如何使用.</p>
<h2 id="安装Compass"><a href="#安装Compass" class="headerlink" title="安装Compass"></a>安装Compass</h2><p>请按照<a href="http://compass-style.org/install/" target="_blank" rel="external">Compass 安装指南</a>按步骤安装Compass和Sass。</p>
<p>如果需要验证版本，可以运行以下命令:</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ compass version</div></pre></td></tr></table></figure>
          <!--noindex-->
          <div class="post-button text-center">
            <a class="btn" href="/articles/compass.html#more" rel="contents">
              阅读全文 &raquo;
            </a>
          </div>
          <!--/noindex-->
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>


    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
  </section>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/3/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/3/">3</a><span class="page-number current">4</span>
  </nav>


          
          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel sidebar-panel-active">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.jpg"
               alt="Sun Hao" />
          <p class="site-author-name" itemprop="name">Sun Hao</p>
          <p class="site-description motion-element" itemprop="description">Whoever wants to be first must be slave of all.</p>
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">40</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">19</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              
                <span class="site-state-item-count">69</span>
                <span class="site-state-item-name">标签</span>
              
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Sun Hao</span>
</div>


<div class="powered-by">
  Erstellt mit  <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user">本站访客数</i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span>人次</span>
  

  
    <span class="site-pv"><i class="fa fa-eye">本站总访问量</i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span>次</span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  

  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	





  
    
    <script>
      var cloudTieConfig = {
        url: document.location.href, 
        sourceId: "",
        productKey: "68d47669d3794a958fbaaee9328b90f3",
        target: "cloud-tie-wrapper"
      };
    </script>
    <script src="https://img1.ws.126.net/f2e/tie/yun/sdk/loader.js"></script>
  







  
  
  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length == 0) {
      search_path = "search.xml";
    }
    var path = "/" + search_path;
    // monitor main search box;

    function proceedsearch() {
      $("body").append('<div class="popoverlay">').css('overflow', 'hidden');
      $('.popup').toggle();
    }
    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';
      $.ajax({
        url: path,
        dataType: "xml",
        async: true,
        success: function( xmlResponse ) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = $( "entry", xmlResponse ).map(function() {
            return {
              title: $( "title", this ).text(),
              content: $("content",this).text(),
              url: $( "url" , this).text()
            };
          }).get();
          var $input = document.getElementById(search_id);
          var $resultContent = document.getElementById(content_id);
          $input.addEventListener('input', function(){
            var matchcounts = 0;
            var str='<ul class=\"search-result-list\">';
            var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
            $resultContent.innerHTML = "";
            if (this.value.trim().length > 1) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var content_index = [];
                var data_title = data.title.trim().toLowerCase();
                var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
                var data_url = decodeURIComponent(data.url);
                var index_title = -1;
                var index_content = -1;
                var first_occur = -1;
                // only match artiles with not empty titles and contents
                if(data_title != '') {
                  keywords.forEach(function(keyword, i) {
                    index_title = data_title.indexOf(keyword);
                    index_content = data_content.indexOf(keyword);
                    if( index_title >= 0 || index_content >= 0 ){
                      isMatch = true;
                      if (i == 0) {
                        first_occur = index_content;
                      }
                    }

                  });
                }
                // show search results
                if (isMatch) {
                  matchcounts += 1;
                  str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
                  var content = data.content.trim().replace(/<[^>]+>/g,"");
                  if (first_occur >= 0) {
                    // cut out 100 characters
                    var start = first_occur - 20;
                    var end = first_occur + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if(start == 0){
                      end = 50;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    var match_content = content.substring(start, end);
                    // highlight all keywords
                    keywords.forEach(function(keyword){
                      var regS = new RegExp(keyword, "gi");
                      match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
                    });

                    str += "<p class=\"search-result\">" + match_content +"...</p>"
                  }
                  str += "</li>";
                }
              })};
            str += "</ul>";
            if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
            if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
            $resultContent.innerHTML = str;
          });
          proceedsearch();
        }
      });}

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched == false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(function(e){
      $('.popup').hide();
      $(".popoverlay").remove();
      $('body').css('overflow', '');
    });
    $('.popup').click(function(e){
      e.stopPropagation();
    });
  </script>


  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  


</body>
</html>
